package com.xwaf.platform.system.provider.serviceimpl.hander;

import org.springframework.stereotype.Service;

import com.xwaf.platform.common.utils.RandomHelper;
import com.xwaf.platform.system.api.entity.hander.TradeOrder;
import com.xwaf.platform.system.api.service.hander.TradeOrderHandler;
import com.xwaf.platform.system.api.service.hander.TradeOrderHandlerChain;

/**
 * 
 * <p>
 * 库存异常
 * <p>
 * 
 * @author 李聪 <br>
 * @email xwaf_love@yeah.net <br>
 * @since JDK 1.8<br>
 * @date 2019年12月27日 下午7:49:04 <br>
 * @see 无<br>
 *      Copyright (c) 2019, xwaf_love@yeah.net All Rights Reserved.<br>
 */
@Service("inventoryExpHandler")
public class InventoryExpHandler implements TradeOrderHandler {

	@Override
	public void process(TradeOrder tradeOrder, TradeOrderHandlerChain chain) {
		int randomInt = RandomHelper.randomInt(100, 200);
		if (randomInt % 2 == 0) {
			tradeOrder.setInventoryExp(true);
		}
		chain.doProcess(tradeOrder);
	}
}
